package com.wiloon.java8x.basic.collection;

import java.util.*;

public class TreeMapX {
    public static void main(String[] args) {
        // creating maps
        TreeMap<Integer, String> treeMap = new TreeMap<Integer, String>();
        SortedMap<Integer, String> treeMapincl = new TreeMap<Integer, String>();

        // populating tree map
        treeMap.put(2, "two");
        treeMap.put(1, "one");
        treeMap.put(3, "three");
        treeMap.put(6, "six");
        treeMap.put(5, "five");
        treeMap.put(4, "four");

        System.out.println("Getting tail map");
        treeMapincl = treeMap.tailMap(3);
        System.out.println("Tail map values: " + treeMapincl);
    }
}